<template>
  <div class="order">
    <div class="top">订单编号：{{ o.orderId }}——{{ o.orderName }}</div>
    <div class="bottom">
      <div class="left"><img :src="o.orderPic" alt="" /></div>
      <div class="center">
        <span>单价：<span>{{ o.price }}</span>元</span>
        <span>总价：<span>{{ o.sum }}</span>元</span>
      </div>
      <div class="right">
        <van-button @click="$emit('cbuy')" type="primary" size="small">购买</van-button>
        <van-button @click="$emit('cdel')" type="danger" size="small">删除</van-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import order1 from "@/types/order1";
const props = defineProps(["order"]);
const o: order1 = props.order;
</script>

<style lang="scss" scoped>
  .order{
    padding: 10px;
    margin: 15px 10px;
    border: 1px solid #07c160;
    border-radius: 20px;
    >.top{
      text-align: center;
      color: #07c160;
      font-weight: bolder;
    }
    >.bottom{
      display: flex;
      justify-content: space-between;
      >.left{
        
        >img{
          width: 120px;
          height: 100px;
          border-radius: 15px;
        }
      }
      >.center{
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        >span{
          >span{
            color: red;
            font-size: 1.6em;
          }
        }
      }
      >.right{
        width: 100px;
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
    }
  }
</style>